/*
 * @Author: 迷洛洛ywc
 * @Date: 2024-02-21 17:06:19
 * @LastEditors: 迷洛洛ywc
 * @LastEditTime: 2024-05-08 21:24:30
 * @Description: file content
 */
const { defineConfig } = require('@vue/cli-service')
const port = process.env.port || process.env.npm_config_port || 9528 // dev port

module.exports = defineConfig({
  transpileDependencies: true,
  publicPath: '/shuzhongtian/', // 开发用这个
  // publicPath: './', // 打包使用
  outputDir: 'dist',
  assetsDir: 'static',
  lintOnSave: process.env.NODE_ENV === 'development',
  productionSourceMap: false,
  devServer: {
    port: port,
    open: true,

    proxy: {
      // '规则':{}
      '/shuzhongtianApi': {
        // 目标服务器
        target: 'https://115.29.207.19:9090/',
        // target: 'https://192.168.0.51:9090/',
        // target: 'https://192.168.1.33:9090/',
        // target: 'http://192.168.1.35:9090/',
        // 路径重写,将自定义的共用接口重写为空
        pathRewrite: {
          '^/shuzhongtianApi': ''
        }
      },
      '/shuzhongtianDeviceApi': {
        // 目标服务器
        target: 'https://115.29.207.19:9093/',
        // target: 'https://192.168.1.33:9093/',

        // 路径重写,将自定义的共用接口重写为空
        pathRewrite: {
          '^/shuzhongtianDeviceApi': ''
        }
      }
      // https://api.tianditu.gov.cn/api?v=4.0&tk=3608866120174dc307d1ce121ccfde22
    }
    // before: require('./mock/mock-server.js')
  }
})
